<?php

/**
 * Created by PhpStorm.
 * User: zuoa
 * Date: 2016/11/25 0025
 * Time: 10:34
 */
class Question_model extends CI_Model
{
    public function __construct()
    {
        $this->load->database();
    }

    public function get_random_questions()
    {
        $query = $this->db->order_by("rand()")->limit(5)->get("tbl_question");
        return $query->result_array();
    }

    public function  get_question($index)
    {
        $query = $this->db->where("id", $index)->get("tbl_question");
        return $query->row();
    }
}